package com.example.demo.convert;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.domain.entity.SysUserCoreDO;
import com.example.demo.domain.param.UserQueryParam;
import com.example.demo.domain.param.UserRegisterRequest;
import com.example.demo.domain.param.UserUpdateParam;
import com.example.demo.domain.vo.UserVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * @author haochen78
 */
@Mapper
public interface UserConvert {
    UserConvert INSTANCE = Mappers.getMapper(UserConvert.class);

    SysUserCoreDO toDO(UserRegisterRequest request);

    UserVO doToVo(SysUserCoreDO userDO);

    Page<UserVO> doToVoPage(Page<SysUserCoreDO> page);

    SysUserCoreDO paramToDo(UserQueryParam param);

    SysUserCoreDO paramToDo(UserUpdateParam param);

}
